home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Freeware 1999 November
/
SGI Freeware 1999 November - Disc 1.iso
/
dist
/
fw_expect.idb
/
usr
/
freeware
/
catman
/
u_man
/
cat1
/
kibitz.Z
/
kibitz
Wrap
Text File
|
1999-01-26
|
12KB
|
265 lines
KKKKIIIIBBBBIIIITTTTZZZZ((((1111)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((11119999 OOOOccccttttoooobbbbeeeerrrr 1111999999994444)))) KKKKIIIIBBBBIIIITTTTZZZZ((((1111))))
NNNNAAAAMMMMEEEE
kibitz - allow two people to interact with one shell
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
kkkkiiiibbbbiiiittttzzzz [ _k_i_b_i_t_z-_a_r_g_s ] _u_s_e_r [ _p_r_o_g_r_a_m _p_r_o_g_r_a_m-_a_r_g_s... ]
kkkkiiiibbbbiiiittttzzzz [ _k_i_b_i_t_z-_a_r_g_s ] _u_s_e_r@_h_o_s_t [ _p_r_o_g_r_a_m _p_r_o_g_r_a_m-_a_r_g_s... ]
IIIINNNNTTTTRRRROOOODDDDUUUUCCCCTTTTIIIIOOOONNNN
kkkkiiiibbbbiiiittttzzzz allows two (or more) people to interact with one
shell (or any arbitrary program). Uses include:
+o A novice user can ask an expert user for help.
Using kkkkiiiibbbbiiiittttzzzz, the expert can see what the user is
doing, and offer advice or show how to do it right.
+o By running kkkkiiiibbbbiiiittttzzzz and then starting a full-screen
editor, people may carry out a conversation,
retaining the ability to scroll backwards, save the
entire conversation, or even edit it while in
progress.
+o People can team up on games, document editing, or
other cooperative tasks where each person has
strengths and weaknesses that complement one
another.
UUUUSSSSAAAAGGGGEEEE
To start kkkkiiiibbbbiiiittttzzzz, user1 runs kibitz with the argument of the
user to kibitz. For example:
kibitz user2
kkkkiiiibbbbiiiittttzzzz starts a new shell (or another program, if given on
the command line), while prompting user2 to run kkkkiiiibbbbiiiittttzzzz. If
user2 runs kkkkiiiibbbbiiiittttzzzz as directed, the keystrokes of both users
become the input of the shell. Similarly, both users
receive the output from the shell.
To terminate kkkkiiiibbbbiiiittttzzzz it suffices to terminate the shell
itself. For example, if either user types ^D (and the shell
accepts this to be EOF), the shell terminates followed by
kkkkiiiibbbbiiiittttzzzz.
Normally, all characters are passed uninterpreted. However,
if the escape character (described when kkkkiiiibbbbiiiittttzzzz starts) is
issued, the user may talk directly to the kkkkiiiibbbbiiiittttzzzz
interpreter. Any EEEExxxxppppeeeecccctttt(1) or TTTTccccllll(3) commands may be given.
Also, job control may be used while in the interpreter, to,
for example, suspend or restart kkkkiiiibbbbiiiittttzzzz.
Various processes can provide various effects. For example,
you can emulate a two-way write(1) session with the command:
Page 1 (printed 12/23/98)
KKKKIIIIBBBBIIIITTTTZZZZ((((1111)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((11119999 OOOOccccttttoooobbbbeeeerrrr 1111999999994444)))) KKKKIIIIBBBBIIIITTTTZZZZ((((1111))))
kibitz user2 sleep 1000000
AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
kkkkiiiibbbbiiiittttzzzz takes arguments, these should also be separated by
whitespace.
The ----nnnnoooopppprrrroooocccc flag runs kkkkiiiibbbbiiiittttzzzz with no process underneath.
Characters are passed to the other kkkkiiiibbbbiiiittttzzzz. This is
particularly useful for connecting multiple interactive
processes together. In this mode, characters are not echoed
back to the typist.
----nnnnooooeeeessssccccaaaappppeeee disables the escape character.
----eeeessssccccaaaappppeeee _c_h_a_r sets the escape character. The default escape
character is ^].
----ssssiiiilllleeeennnntttt turns off informational messages describing what
kibitz is doing to initiate a connection.
----ttttttttyyyy _t_t_y_n_a_m_e defines the tty to which the invitation should
be sent.
If you start kkkkiiiibbbbiiiittttzzzz to user2 on a remote computer, kkkkiiiibbbbiiiittttzzzz
performs a rrrrllllooooggggiiiinnnn to the remote computer with your current
username. The flag ----pppprrrrooooxxxxyyyy _u_s_e_r_n_a_m_e causes rrrrllllooooggggiiiinnnn to use
_u_s_e_r_n_a_m_e for the remote login (e.g. if your account on the
remote computer has a different username). If the ----pppprrrrooooxxxxyyyy
flag is not given, kkkkiiiibbbbiiiittttzzzz tries to determine your current
username by (in that order) inspecting the environment
variables USER and LOGNAME, then by using the commands
wwwwhhhhooooaaaammmmiiii and llllooooggggnnnnaaaammmmeeee.
The arguments ----nnnnooooeeeessssccccaaaappppeeee and ----eeeessssccccaaaappppeeee can also be given by
user2 when prompted to run kkkkiiiibbbbiiiittttzzzz.
MMMMOOOORRRREEEE TTTTHHHHAAAANNNN TTTTWWWWOOOO UUUUSSSSEEEERRRRSSSS
The current implementation of kibitz explicitly understands
only two users, however, it is nonetheless possible to have
a three (or more) -way kibitz, by kibitzing another kkkkiiiibbbbiiiittttzzzz.
For example, the following command runs kkkkiiiibbbbiiiittttzzzz with the
current user, user2, and user3:
% kibitz user2 kibitz user3
Additional users may be added by simply appending more
"kibitz user" commands.
The xxxxkkkkiiiibbbbiiiittttzzzz script is similar to kkkkiiiibbbbiiiittttzzzz but supports the
ability to add additional users (and drop them) dynamically.
Page 2 (printed 12/23/98)
KKKKIIIIBBBBIIIITTTTZZZZ((((1111)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((11119999 OOOOccccttttoooobbbbeeeerrrr 1111999999994444)))) KKKKIIIIBBBBIIIITTTTZZZZ((((1111))))
CCCCAAAAVVVVEEEEAAAATTTTSSSS
kkkkiiiibbbbiiiittttzzzz assumes the 2nd user has the same terminal type and
size as the 1st user. If this assumption is incorrect,
graphical programs may display oddly.
kkkkiiiibbbbiiiittttzzzz handles character graphics, but cannot handle
bitmapped graphics. Thus,
% xterm -e kibitz will work
% kibitz xterm will not work
However, you can get the effect of the latter command by
using xxxxkkkkiiiibbbbiiiittttzzzz (see SEE ALSO below). kkkkiiiibbbbiiiittttzzzz uses the same
permissions as used by rlogin, rsh, etc. Thus, you can only
kkkkiiiibbbbiiiittttzzzz to users at hosts for which you can rlogin.
Similarly, kkkkiiiibbbbiiiittttzzzz will prompt for a password on the remote
host if rlogin would.
If you kkkkiiiibbbbiiiittttzzzz to users at remote hosts, kkkkiiiibbbbiiiittttzzzz needs to
distinguish your prompt from other things that may precede
it during login. (Ideally, the end of it is preferred but
any part should suffice.) If you have an unusual prompt,
set the environment variable EXPECT_PROMPT to an egrep(1)-
style regular expression. Brackets should be preceded with
one backslash in ranges, and three backslashes for literal
brackets. The default prompt r.e. is "($|%|#) ".
kkkkiiiibbbbiiiittttzzzz requires the kkkkiiiibbbbiiiittttzzzz program on both hosts. kkkkiiiibbbbiiiittttzzzz
requires eeeexxxxppppeeeecccctttt(1).
By comparison, the xxxxkkkkiiiibbbbiiiittttzzzz script uses the X authorization
mechanism for inter-host communication so it does not need
to login, recognize your prompt, or require kibitz on the
remote host. It does however need permission to access the
other X servers.
BBBBUUUUGGGGSSSS
An early version of Sun's tmpfs had a bug in it that causes
kkkkiiiibbbbiiiittttzzzz to blow up. If kkkkiiiibbbbiiiittttzzzz reports "error flushing ...:
Is a directory" ask Sun for patch #100174.
If your Expect is not compiled with multiple-process support
(i.e., you do not have a working select or poll), you will
not be able to run kibitz.
EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT
The environment variable SHELL is used to determine the
shell to start, if no other program is given on the command
line.
If the environment variable EXPECT_PROMPT exists, it is
taken as a regular expression which matches the end of your
Page 3 (printed 12/23/98)
KKKKIIIIBBBBIIIITTTTZZZZ((((1111)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((11119999 OOOOccccttttoooobbbbeeeerrrr 1111999999994444)))) KKKKIIIIBBBBIIIITTTTZZZZ((((1111))))
login prompt (but does not otherwise occur while logging
in). See also CAVEATS above.
If the environment variables USER or LOGNAME are defined,
they are used to determine the current user name for a
kkkkiiiibbbbiiiittttzzzz to a remote computer. See description of the ----pppprrrrooooxxxxyyyy
option in ARGUMENTS above.
SSSSEEEEEEEE AAAALLLLSSSSOOOO
TTTTccccllll(3), lllliiiibbbbeeeexxxxppppeeeecccctttt(3), xxxxkkkkiiiibbbbiiiittttzzzz(1)
"_E_x_p_l_o_r_i_n_g _E_x_p_e_c_t: _A _T_c_l-_B_a_s_e_d _T_o_o_l_k_i_t _f_o_r _A_u_t_o_m_a_t_i_n_g
_I_n_t_e_r_a_c_t_i_v_e _P_r_o_g_r_a_m_s" by Don Libes, O'Reilly and Associates,
January 1995.
"_K_i_b_i_t_z - _C_o_n_n_e_c_t_i_n_g _M_u_l_t_i_p_l_e _I_n_t_e_r_a_c_t_i_v_e _P_r_o_g_r_a_m_s
_T_o_g_e_t_h_e_r", by Don Libes, Software - Practice & Experience,
John Wiley & Sons, West Sussex, England, Vol. 23, No. 5,
May, 1993.
AAAAUUUUTTTTHHHHOOOORRRR
Don Libes, National Institute of Standards and Technology
kkkkiiiibbbbiiiittttzzzz is in the public domain. NIST and I would appreciate
credit if this program or parts of it are used.
Page 4 (printed 12/23/98)